Home |
| Latest | About | Random
# 26 Geometric transformations. We see that a general functions can be kind of abstract, but a linear transformations are more rigid. In particular, since linear maps preserve sums and preserve scaling, together they **preserve parallelopipeds**. Diagrammatically, if $T$ is linear, then we have the following: ![[1 teaching/smc-spring-2024-math-13/linear-algebra-notes/---files/26-geometric-transformations 2024-03-25 13.06.57.excalidraw.svg]] %%[[1 teaching/smc-spring-2024-math-13/linear-algebra-notes/---files/26-geometric-transformations 2024-03-25 13.06.57.excalidraw|🖋 Edit in Excalidraw]]%% That is, the parallelogram $P$ of vectors formed by two vectors $\vec v,\vec w$ in the domain, all get sent to a parallelogram $T(P)$ of vectors formed by $T(\vec v)$ and $T(\vec w)$. Indeed, if a vector $\vec x$ is in the parallelogram formed by $\vec v$ and $\vec w$, then such vector has a form $a \vec v + b\vec w$ where $0\le a,b,\le 1$. Then, the image of $\vec x$ under the linear map $T$ is just $T(\vec x)=T(a\vec v+ b\vec w)=aT(\vec v)+bT(\vec w)$, which is a linear combination of $T(\vec v)$ and $T(\vec w)$ with the same weights $a,b$, so it lies in the parallelogram formed by $T(\vec v)$ and $T(\vec w)$. And actually, even if this parallelopiped is not fixed at the origin, a linear map would still transform it into a parallelopiped, like so ![[1 teaching/smc-spring-2024-math-13/linear-algebra-notes/---files/26-geometric-transformations 2024-03-25 16.57.27.excalidraw.svg]] %%[[1 teaching/smc-spring-2024-math-13/linear-algebra-notes/---files/26-geometric-transformations 2024-03-25 16.57.27.excalidraw|🖋 Edit in Excalidraw]]%% So bottom line: > If $T$ is a linear map, then parallelopipeds get send to parallelopipeds. (Parallelopiped is just a higher dimensional version of parallelogram.) Let us look at some concrete examples of linear transformations $T:\mathbb{R}^{2}\to \mathbb{R}^{2}$ between planes. Since these are linear maps between Euclidean plane $\mathbb{R}^{2}$, we know that they are all left matrix multiplication maps, $T(\vec x)= A\vec x$ for some matrix $A$. Recall the $k$-th column of $A$ is just $T(\vec e_{k})$, where $\vec e_{k}$ is the $k$-th column of the $k\times k$ identity matrix $I_{k}$. ## Identity transformation. If the matrix $A = I_{2}=\begin{pmatrix}1 &0\\0 &1\end{pmatrix}$ is an identity matrix, then the linear map $T:\mathbb{R}^{2}\to\mathbb{R}^{2}$ given by $T(\vec x)=A\vec x = \vec x$ is the "do nothing map", or the identity map. That is, $T$ returns the input as output. ## Reflection across the axes. If the matrix $A = \begin{pmatrix}-1& 0 \\ 0 & 1\end{pmatrix}$, then $T(\vec x)=A\vec x: \mathbb{R}^{2}\to \mathbb{R}^{2}$ is a **reflection about the $y$-axis** map. It is probably better to think of it as "it switches the $x$-coordinate to negative of the $x$-coordinate". Diagrammatically ![[1 teaching/smc-spring-2024-math-13/linear-algebra-notes/---files/26-geometric-transformations 2024-03-25 13.50.18.excalidraw.svg]] %%[[1 teaching/smc-spring-2024-math-13/linear-algebra-notes/---files/26-geometric-transformations 2024-03-25 13.50.18.excalidraw|🖋 Edit in Excalidraw]]%% Similarly $A = \begin{pmatrix}1&0\\0&-1\end{pmatrix}$ is reflection about the $x$-axis map, that switches $y$ to $-y$, as shown here ![[1 teaching/smc-spring-2024-math-13/linear-algebra-notes/---files/26-geometric-transformations 2024-03-25 16.49.38.excalidraw.svg]] %%[[1 teaching/smc-spring-2024-math-13/linear-algebra-notes/---files/26-geometric-transformations 2024-03-25 16.49.38.excalidraw|🖋 Edit in Excalidraw]]%% ## Scaling in the axes. Consider matrix of the form $A = \begin{pmatrix}a &0\\0&b\end{pmatrix}$ for some real numbers $a$ and $b$. Then what is the linear map $T:\mathbb{R}^{2}\to \mathbb{R}^{2}$ given by $T(\vec x)=\begin{pmatrix}a &0\\0&b\end{pmatrix} \vec x$ doing? Well if we write $\vec x = \begin{pmatrix}x\\y\end{pmatrix}$, then we see that $$ T\begin{pmatrix}x\\y\end{pmatrix}=\begin{pmatrix}a & 0 \\ 0 & b\end{pmatrix}\begin{pmatrix}x\\y\end{pmatrix}=\begin{pmatrix}ax\\by\end{pmatrix}. $$This map scales in the $x$-direction by factor of $a$, and scales in the $y$-direction by a factor of $b$. A diagram of this is as follows: ![[1 teaching/smc-spring-2024-math-13/linear-algebra-notes/---files/26-geometric-transformations 2024-03-25 13.24.47.excalidraw.svg]] %%[[1 teaching/smc-spring-2024-math-13/linear-algebra-notes/---files/26-geometric-transformations 2024-03-25 13.24.47.excalidraw|🖋 Edit in Excalidraw]]%% Note, if the scalar $a$ or $b$ is negative, then it flips the axis over, as shown in this diagram above. ## Rotation. If we rotate vectors on the plane counterclockwise by a fixed angle $\theta$ about the origin, then it is in fact a linear transformation. Let us denote this linear transformation as $R_{\theta}:\mathbb{R}^{2}\to \mathbb{R}^{2}$. What its standard matrix $A_{\theta} = [R_{\theta}]_{\text{std}}$ to this linear transformation such that $R_\theta (\vec x) = A_{\theta}\vec x$? By trigonometry, we can see that the matrix $A_{\theta}$ is given by $$ A_{\theta} = \begin{pmatrix}\cos\theta & -\sin\theta \\ \sin\theta & \cos\theta\end{pmatrix}. $$Diagrammatically we have ![[smc-spring-2024-math-13/linear-algebra-notes/---files/26-geometric-transformations 2024-03-25 17.29.50.excalidraw.svg]] %%[[smc-spring-2024-math-13/linear-algebra-notes/---files/26-geometric-transformations 2024-03-25 17.29.50.excalidraw.md|🖋 Edit in Excalidraw]]%% ## Orthogonal projection along a direction. Fix a **unit vector** $\vec u = \begin{pmatrix} u_{1}\\u_{2}\end{pmatrix}$ in the plane, which means the length of $\vec u$ is 1, namely ${u_{1}^{2}+u_{2}^{2}}=1^{2}=1$. This defines a direction and a line $L = \operatorname{span}(\vec u)$ in the plane. Now let us describe the process of **orthogonal projection along direction $\vec u$** . Take any vector $\vec x$ in the plane, and from the tip of $\vec x$ draw a **perpendicular altitude** to the line $L$, which intersects somewhere on the line $L$. ![[smc-spring-2024-math-13/linear-algebra-notes/---files/26-geometric-transformations 2024-03-26 10.28.21.excalidraw.svg]] %%[[smc-spring-2024-math-13/linear-algebra-notes/---files/26-geometric-transformations 2024-03-26 10.28.21.excalidraw.md|🖋 Edit in Excalidraw]]%% This vector in line $L$ from the origin to this intersection is called the **orthogonal projection of $\vec x$ along $\vec u$**, and we denote it as $\text{proj}_{\vec u}(\vec x)$. Think of $\text{proj}_{\vec u}(\vec x)$ as the **shadow that $\vec x$ casts down onto the line $L$, in a perpendicular direction.** It turns out that this defines a linear transformation $\text{proj}_{\vec u}:\mathbb{R}^{2}\to \mathbb{R}^{2}$, whose formula is given by $$ \text{proj}_{\vec u}(\vec x) = (\vec u \cdot \vec x)\vec u $$where $\vec u \cdot\vec x$ is the **dot product** between the two vectors, giving a scalar, which then scales $\vec u$. It is important to use a unit vector $\vec u$. If we denote $P_{\vec u} = [\text{proj}_{\vec u}]_{\text{std}}$ to be the standard matrix of this linear map, it would be $$ P_{\vec u} = \begin{pmatrix}u_{1}^{2} & u_{1}u_{2} \\ u_{1} u_{2} & u_{2}^{2}\end{pmatrix}. $$You should verify above. ## Reflection across a line. Suppose we have a line $L = \operatorname{span}(\vec u)$ through the origin in the direction $\vec u = \begin{pmatrix}u_{1} \\ u_{2}\end{pmatrix}$, where $\vec u$ is a **unit vector**. Reflection across this line is a linear transformation $T_{L}:\mathbb{R}^{2}\to \mathbb{R}^{2}$. As it turns out, we can write out its formula as $$ T_{L}(\vec x) = 2 (\vec u \cdot \vec x)\vec u -\vec x $$here $\cdot$ means dot product. This formula can be obtained by knowing the fact that the quantity $(\vec u\cdot \vec x)\vec u$ is the projection of $\vec x$ along the $\vec u$ direction. So applying the characterization we can write down its standard matrix $A_{L} = [T_{L}]_{\text{std}}$ as follows: $$ A_{L} = \begin{pmatrix}2u_{1}^{2}-1 & 2u_{1}u_{2} \\ 2u_{1}u_{2} & 2u_{2}^{2}-1\end{pmatrix}. $$Again, you should verify this. Now, if the unit vector $\vec u = \begin{pmatrix}\cos\theta \\ \sin \theta\end{pmatrix}$ is given in terms of the angle $\theta$, then the standard matrix now read $$ A_{L} = \begin{pmatrix}2\cos^{2}\theta -1 & 2\cos\theta\sin\theta \\ 2\cos\theta\sin\theta & 2\sin^{2}\theta-1\end{pmatrix} = \begin{pmatrix}\cos 2\theta & \sin2\theta \\ \sin2\theta & -\cos2\theta\end{pmatrix} $$by using trigonometric identities. Pay attention to the **signs** here and compare that to the rotation matrix. ## Some thoughts: What is a linear map doing? A preview. It seems like we can attempt to visualize what a linear transformation is doing, especially when it is between planes. But what if we are in higher dimensions? And further, it also isn't necessarily completely clear what a linear transformation is doing by looking at what it does on a square box formed by the standard vectors $\vec e_{1}, \vec e_{2}$ etc. Let us look at this example: **Example.** Consider the linear map $T:\mathbb{R}^{2}\to \mathbb{R}^{2}$ given by the matrix $$ A = \begin{pmatrix}11 & -12 \\ 6 & -6\end{pmatrix} $$where $T(\vec x) = A \vec x$. Can we tell what $T$ is doing? Well let us analyze the action of $T$ on a unit box formed by $\vec e_{1}$ and $\vec e_{2}$. We know by our characterization $$ T(\vec e_{1}) = \begin{pmatrix}11\\6\end{pmatrix}\quad\text{and}\quad T(\vec e_{2}) = \begin{pmatrix}-12 \\ -6\end{pmatrix}. $$So we have a diagram ![[smc-spring-2024-math-13/linear-algebra-notes/---files/26-geometric-transformations 2024-03-26 11.00.28.excalidraw.svg]] %%[[smc-spring-2024-math-13/linear-algebra-notes/---files/26-geometric-transformations 2024-03-26 11.00.28.excalidraw.md|🖋 Edit in Excalidraw]]%% Though nice, but it can be more informative if we shift our perspective. Consider instead this. the vector $\vec v_{1} = \begin{pmatrix}3\\2\end{pmatrix}$ and $\vec v_{2} = \begin{pmatrix}4\\3\end{pmatrix}$. Let us look at what $T$ do to these to two vectors. $$ T (\vec v_{1}) = \begin{pmatrix}9\\6\end{pmatrix} = 3v_{1} \quad\text{and}\quad T(\vec v_{2}) = \begin{pmatrix}8\\6\end{pmatrix} = 2v_{2}. $$ This means, $T$ simply stretches $\vec v_{1}$ by a factor of $3$, and $T$ stretches $\vec v_{2}$ by a factor of $2$. How curious! We have the following diagram instead: ![[1 teaching/smc-spring-2024-math-13/linear-algebra-notes/---files/26-geometric-transformations 2024-03-26 11.09.46.excalidraw.svg]] %%[[1 teaching/smc-spring-2024-math-13/linear-algebra-notes/---files/26-geometric-transformations 2024-03-26 11.09.46.excalidraw|🖋 Edit in Excalidraw]]%% What this informs us is, if we want to know what happens to a vector $\vec x$ under the map $T$, we should express $\vec x$ as a linear combination of $\vec v_{1}$ and $\vec v_{2}$ instead, as if they are our new "coordinate axes". Say $\vec x = a \vec v_{1} + b \vec v_{2}$. Then under map $T$ , we have then $T(\vec x)=a T(\vec v_{1}) + bT(\vec v_{2})=3a\vec v_{1}+2b\vec v_{2}$. So the result $T(\vec x)$ is just stretching $\vec x$ along the $\vec v_{1}$ direction by $3$, and stretch $\vec x$ along the $\vec v_{2}$ direction by $2$. So in some sense $\vec v_{1},\vec v_{2}$ are better choices of basis for $\mathbb{R}^{2}$ than just $\vec e_{1},\vec e_{2}$ when we want to discuss the linear map $T$. This is the idea of **eigenvalues and eigenvectors**, and **diagonalization**, which we will encounter down the line. This process isn't always possible, but when we can it is amazing. Just keep this idea in mind.